package com.example.combwyaq.test;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.example.combwyaq.R;
import com.example.combwyaq.widget.DotWidget;

public class Main2Activity extends AppCompatActivity {

    private DotWidget redDotView;
    private Button but;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        initView();
        but.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                change(v);
            }
        });

    }
    public void change(View view){
        if (redDotView.getIsShow()) redDotView.setIsShow(false);
        else  redDotView.setIsShow(true);
    }

    private void initView() {
        redDotView = (DotWidget) findViewById(R.id.redDotView);
        but = (Button) findViewById(R.id.but);
    }
}
